<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8" />
	<link rel="apple-touch-icon" sizes="76x76" href="./assets/img/favicon.ico">
	<link rel="icon" type="image/png" href="./assets/img/favicon.ico">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title>数据资产管理平台</title>
	<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
		name='viewport' />



	<!-- Font Awesome Icons -->
	<link rel="stylesheet" href="assets/font/iconfont.css">

	<!-- Main CSS -->
	<link href="./assets/css/main.css" rel="stylesheet" />
	<link rel="stylesheet" href="assets/css/index.css">

	<!-- Animation CSS -->
	<link href="vendor/aos.css" rel="stylesheet" />
	<link href="./assets/layui/css/layui.css" rel="stylesheet">
	<style>
		body {
			font-size: 17px;
		}

		.nav-item .active {
			font-weight: 600;
		}

		/* 修改header的样式 */
		.nav-link {
			color: #353c58 !important;
		}

		.navbar-dark .navbar-brand:hover,
		.navbar-dark .navbar-brand:focus {
			color: #FF6A00;
		}

		.btn-outline-white:hover {
			background-color: rgba(244, 244, 244, 0.7);
			border-color: #FF6A00 !important;
		}

		.navbar-dark .navbar-brand {
			color: #353c58;
		}

		.navbar {
			background-color: rgba(244, 244, 244, 0.5);
		}

		.nav-link.active {
			color: #FF6A00 !important;
		}

		.nav-link.active,
		.nav-link.active1 {
			color: #FF6A00 !important;
		}

		.page-item.active .page-link {
			z-index: 1;
			color: #fff;
			background-color: #FF6A00;
			border-color: #FF6A00;
		}

		/* end */

		.messageList li {
			display: block !important;
			border-bottom: 1px solid rgba(0, 0, 0, .06);
			box-sizing: border-box;
			padding: 30px 20px 20px;
			position: relative;
		}

		.messageList li h4 {
			font-weight: 600 !important;
			font-size: 1rem;
			margin-bottom: 10px;
		}

		.messageList li>div {
			font-size: 14px;
			color: #666;
		}

		/* 最新信息大字 */
		/* 大于1680px：默认 */
		/*1360px ——1680px */
		@media (max-width: 1680px) {
			.jumbotron {
				padding-top: 9rem;
			}
		}

		/* 小于1360px */
		@media (max-width: 1360px) {
			.display-3 {
				font-size: 60px;
			}

			.display-3 p {
				font-size: 60px;
			}

			.jumbotron {
				padding-top: 11rem;
			}
		}

		.searchHeaderBox {
			position: absolute;
			top: 83px;
			z-index: 1999;
			background-color: white;
			width: 400px;
			left: 856px;
			padding: 10px;
		}

		.searchHeaderBox .label {
			padding: 3px 8px;
			border: 1px solid #d8d8d8;
			margin-right: 12px;
			margin-bottom: 10px;
		}

		::-webkit-input-placeholder {
			/* WebKit browsers */
			color: #999;
			font-size: 14px;
		}

		::-moz-placeholder {
			/* Mozilla Firefox 19+ */
			color: #999;
			font-size: 14px;
		}

		:-ms-input-placeholder {
			/* Internet Explorer 10+ */
			color: #999;
			font-size: 14px;
		}
	</style>
</head>

<body>

	<!----------------------------------------------------------------------
	NAVBAR (remove topnav if you don't want changed nav background on scroll)
	------------------------------------------------------------------------>
	<nav class="topnav navbar navbar-expand-lg navbar-dark fixed-top">
		<div class="container-fluid">
			<a class="navbar-brand" href="./index.html"><i class="iconfont icon-globe1 mr-2"
					style="font-size: 20px;"></i><strong>数据资产管理</strong>
			</a>
			<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarColor02"
				aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<div class="navbar-collapse collapse" id="navbarColor02">
				<ul class="navbar-nav mr-auto d-flex align-items-center">
					<li class="nav-item">
						<a class="nav-link" href="./index.html">门户首页</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="./dataResources.html">公开数据</a>
					</li>
<!--					<li class="nav-item dropdown">-->
<!--						<a class="nav-link" href="productStore.html">数据产品 </a>-->
<!--					</li>-->
<!--					<li class="nav-item">-->
<!--						<a class="nav-link" href="./serviceStore.html">服务产品</a>-->
<!--					</li>-->
<!--					<li class="nav-item">-->
<!--						<a class="nav-link" href="./customShop.html">定制数据</a>-->
<!--					</li>-->
					<li class="nav-item">
						<a class="nav-link" href="./developer.html">平台介绍</a>
					</li>
					<li class="nav-item">
						<a class="nav-link active" href="#">平台资讯</a>
					</li>
<!--					<li class="nav-item">-->
<!--						<a class="nav-link" href="./accessData.html">数据访问</a>-->
<!--					</li>-->
					<!-- <li class="nav-item highSerachBtn">
						<div class="col pt-4 pb-4">
							<a class="btn btn-lg btn-outline-white btn-round searchKeyword text-white"
								style="color: #353c58 !important;border-color: #353c58;"><span class="iconbox border-0"
									style="margin-right: 5px;"><i class="iconfont icon-search"
										style="font-size: 20px;"></i></span>搜索</a>
						</div>
					</li> -->
				</ul>
				<ul class="navbar-nav ml-auto d-flex align-items-center">
<!--					<li class="nav-item">-->
<!--						<a class="nav-link myBtn" href="javascript:;">-->
<!--							<span class="iconbox border-0" style="margin-right: 5px;"><i-->
<!--									class="iconfont icon-cart-arrow-down"></i></span>产品袋-->
<!--						</a>-->
<!--					</li>-->
<!--					<li class="nav-item">-->
<!--						<a class="nav-link" href="./mySpace.html">-->
<!--							<span class="iconbox border-0" style="margin-right: 5px;"><i-->
<!--									class="iconfont icon-bxs-book-reader"></i></span>用户中心 </a>-->
<!--					</li>-->
					<li class="nav-item">
						<a class="nav-link" href="./mySpace.html">
							<span class="iconbox border-0" style="margin-right: 5px;"><i class="iconfont icon-bxs-book-reader"></i></span>用户中心 </a>
					</li>
					<li class="nav-item disabledNone" id="userInfo">
						<ul class="layui-nav" style="background-color: rgba(244, 244, 244, 0);padding: 0;">
							<li class="layui-nav-item">
							  <a href="javascript:;" style="color: #353c58 !important;">
								  <span class="iconbox border-0" style="margin-right: 5px;"><i class="iconfont icon-user-fill"></i></span>
								  用户：<span id="accunt">登录过期</span><span id="accountDisplay" style="margin-left: 10px;"></span>
							  </a>
							  <dl class="layui-nav-child">
								<dd><a href="./changePassword.html">修改密码</a></dd>
								<dd><a href="" id="logOutBtn">退出登录</a></dd>
							  </dl>
							</li>
						  </ul>
					</li>
					<li class="nav-item disabledNone" id="attestation">
						<a class="nav-link" style="color:#FF820C;padding-left: 0px;font-size:12px;cursor: pointer;">未认证</a>
					</li>
					<li class="nav-item disabledNone noUser">
						<a class="nav-link" href="./login.html">
							<span class="iconbox border-0" style="margin-right: 5px;"><i
									class="iconfont icon-user-fill"></i></span>登录 </a>
					</li>
					<li class="nav-item disabledNone noUser">
						<span class="nav-link" href="#">
							<a class="btn btn-success btn-round shadow-sm text-white" href="./register.html">
								<i class="iconfont icon-github"></i> 立即注册
							</a>
						</span>
					</li>
				</ul>
			</div>
		</div>
	</nav>
	<!-- End Navbar -->


	<!-------------------------------------- HEADER --------------------------------------->
	<div class="jumbotron jumbotron-lg jumbotron-fluid mb-0 pb-3 bg-primary position-relative"
		 style="background-color: #FF6A00 !important;">
		<div class="container-fluid text-white h-100">
			<div class="d-lg-flex align-items-center justify-content-between text-center pl-lg-5">
				<div class="col pt-4 pb-4">
					<h1 class="display-3"><strong>最新消息</strong></h1>
					<h2 class="font-weight-light mb-4"><strong>newMessage</strong><strong></strong></h2>
					<!-- <a href="#" class="btn btn-lg btn-outline-white btn-round">了解更多</a> -->
				</div>
				<div class="col align-self-bottom align-items-right text-right h-max-380 h-xl-560 position-relative z-index-1">
					<img src="./assets/img/demo/O1CN0561.jpg" class="rounded img-fluid" style="float: left;">
				</div>
			</div>
		</div>
	</div>
	<!-- End Header -->


	<!-------------------------------------- MAIN --------------------------------------->
<!--	<div class="container pt-5 pb-5 mb-5">-->
<!--		<ul class="messageList">-->

<!--		</ul>-->
<!--		&lt;!&ndash; End Main &ndash;&gt;-->
<!--		<section class="pt-4 pb-5 pagehelper" data-aos="fade-up">-->
<!--			<nav aria-label="Page navigation example" style="float: right;">-->
<!--				<ul class="pagination">-->

<!--				</ul>-->
<!--			</nav>-->
<!--		</section>-->
<!--	</div>-->
	<div class="container pt-5 pb-5 mb-5">
		<ul class="messageList list-group" style="min-height: 110px;">
			<!-- <li class="list-group-item">
				<h4><a href="newMessageDetial.html?id=1">测试新闻标题1</a></h4>
				<div class="mb-2">测试新闻摘要内容1</div>
				<div>
					<i class="iconfont icon-user-fill"></i> 发布人：测试用户1
					<span style="margin-left: 10%;"><i class="iconfont icon-shijian"></i> 2024-06-01</span>

				</div>
			</li> -->

		</ul>
		<section class="pt-4 pb-5 pagehelper" data-aos="fade-up">
			<nav aria-label="Page navigation example" style="float: right;">
				<ul class="pagination">
					<li class="page-item previous"> <a class="page-link" href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
					<li class="page-item"><a class="page-link pageN" href="#">1</a></li>
					<li class="page-item"><a class="page-link pageN" href="#">2</a></li>
					<li class="page-item next"><a class="page-link" href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
				</ul>
			</nav>
		</section>
	</div>






	<!-------------------------------------- FOOTER 底部 --------------------------------------->

	<footer class="bg-black pb-5" style="padding-top: 20px;padding-bottom: 20px !important;background-color: #FF6A00;">
		<div class="container">
			<div class="row" style="text-align: center;">
				<div class="col-12 col-md mr-4">
					<small class="d-block mt-3 text-muted" style="color: white !important;">
						<p style="color: white;margin-top: 10px;margin-bottom: 20px;font-size: 30px;">数据资产管理平台</p>
						Copyright @ 2022 数据资产管理平台-版权所有 蜀ICP备202223603号
					</small>
					<small class="d-block mt-3 text-muted" style="color: white !important;">
						<a href="./legal.html" style="color: white;">隐私政策</a> |
						<a href="./legal.html" style="color: white;">服务条款</a> |
						<a href="./legal.html" style="color: white;">版权声明</a>
					</small>
				</div>
			</div>
		</div>
	</footer>

	<!-- End Footer -->



	<!-------------------------------------- JAVASCRIPTS --------------------------------------->
	<script src="vendor/jquery.min.js" type="text/javascript"></script>
	<script src="vendor/popper.min.js" type="text/javascript"></script>
	<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="js/functions.js" type="text/javascript"></script>
	<script src="./assets/layui/layui.js" type="text/javascript"></script>
	<script src="js/tool.js" type="text/javascript"></script>
	<script src="js/header.js" type="text/javascript"></script>
	<!-- Animation -->
	<script src="vendor/aos.js" type="text/javascript"></script>
	<noscript>
		<style>
			*[data-aos] {
				display: block !important;
				opacity: 1 !important;
				visibility: visible !important;
			}
		</style>
	</noscript>
	<script>
		AOS.init({
			duration: 700
		});
	</script>

	<!-- Disable animation on less than 1200px, change value if you like -->
	<script>
		AOS.init({
			disable: function () {
				var maxWidth = 1200;
				return window.innerWidth < maxWidth;
			}
		});
	</script>
	<script>
		$(function () {
			// 获取最新消息的数据
			let pageNum = 1, pageSize = 8;

			// 定义一个函数根据 infoType 返回类别名称
			function getCategoryName(infoType) {
				switch (infoType) {
					case 0:
						return '类别1';
					case 1:
						return '类别2';
					case 2:
						return '类别3';
					case 3:
						return '类别4';
					default:
						return '未知类别';
				}
			}

			function RequestMessageList(parame) {
				$.ajax({
					timeout: 30000,
					type: 'GET',
					url: window.Http + "/publishInfo/list",
					headers: {
						'Authorization': "Bearer " + sessionStorage.getItem('Token')
					},
					data: parame,
					success: function (res) {
						console.log(res);
						if (res.code == 200) {
							if (res.rows && res.rows.length > 0) {
								let html = "";
								res.rows.forEach(item => {
									html += `
                            <li style="display: flex">
                                <div style="">
                                <div class="card-body" style="width: 100px;height: 100px;float: right">
                                     <img  class="d-block w-100" src="./assets/img/demo/news.png" alt="更多分类">
                                </div>
                                    <h4 style="width: 80%;"><a href="newMessageDetial.html?id=${item.id}">${item.title}</a></h4>

                                    <div class="mb-2">${item.content}</div>

                                    <div>
                                        <i class="iconfont icon-user-fill"></i> 发布人：${item.releaseUserName}
                                        <span style="margin-left: 10%;"><i class="iconfont icon-shijian"></i> ${item.releaseTime.slice(0, 10)}</span>
                                        <span style="margin-left: 10%;"><i class="iconfont icon-yanjing"></i> 信息类别：${getCategoryName(item.infoType)}</span>
                                    </div>

                                </div>

                            </li>
                        `;
								});
								$(".messageList").html(html);
							}
							renderPage(res.total, parame.pageNum);
						} else {
							let html = "暂无数据";
							$(".messageList").html(html);
							renderPage(0, 1);
						}
					}
				});
			}

			//处理分页
			let pageNumber;
			function renderPage(num, pagen) {
				pagen -= -1;
				pageNumber = Math.ceil(num / pageSize);
				let html = '';
				$('.pagination').empty();
				$('.pagination').append(`
            <li class="page-item previous">
                <a class="page-link" href="#" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <li class="page-item next">
                <a class="page-link" href="#" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>`
				);
				for (var i = 1; i <= pageNumber; i++) {
					html += `<li class="page-item"><a class="page-link pageN" href="#">` + i + `</a></li>`;
				}
				$('.pagination li:first-child').after(html);
				$('.pagination li:nth-child(' + pagen + ')').addClass('active');
			}

			(function () {
				let parame = { pageNum, pageSize };
				RequestMessageList(parame);
			}());

			// 分页(数字)
			$('.pagination').on('click', '.pageN', function (e) {
				e.preventDefault();
				// 获取页数
				let num = $(this)[0].innerHTML;
				let parame = { pageSize, pageNum: num };
				RequestMessageList(parame);// 发送请求
			});

			// 分页(上一页)
			$('.pagination').on('click', '.previous', function (e) {
				e.preventDefault();
				// 获取当前页数
				let num = $(this).siblings('.active')[0].children[0].innerHTML;
				if (num > 1) {
					num -= 1;
					let parame = {
						pageSize,
						pageNum: num
					};
					RequestMessageList(parame);// 发送请求
				}
			});

			// 分页(下一页)
			$('.pagination').on('click', '.next', function (e) {
				e.preventDefault();
				// 获取当前页数
				let num = $(this).siblings('.active')[0].children[0].innerHTML;
				if (num <= pageNumber) {
					num -= -1;
					let parame = {
						pageSize,
						pageNum: num
					};
					RequestMessageList(parame);// 发送请求
				}
			});
		});

	</script>
</body>

</html>
